<template>
  <el-card shadow="never" class="aui-card--fill">
    <div class="mod-sys__dict">
      <el-form
        :inline="true"
        :model="dataForm"
        @keyup.enter.native="getDataList()"
      >
        <el-form-item>
          <el-input
            v-model="dataForm.adminName"
            placeholder="请输入账号"
            clearable
          ></el-input>
        </el-form-item>
        <!-- <el-form-item>
          <el-input
            v-model="dataForm.code"
            placeholder="请输入企业编码"
            clearable
          ></el-input>
        </el-form-item> -->
        <el-form-item>
          <el-input
            v-model="dataForm.linkName"
            placeholder="请输入联系人"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-input
            v-model="dataForm.linkPhone"
            placeholder="请输入联系电话"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-input
            v-model="dataForm.name"
            placeholder="请输入商户名称"
            clearable
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-button @click="getDataList()">{{ $t("query") }}</el-button>
        </el-form-item>
      </el-form>
      <el-table
        v-loading="dataListLoading"
        :data="dataList"
        border
        @selection-change="dataListSelectionChangeHandle"
        @sort-change="dataListSortChangeHandle"
        style="width: 100%"
      >
        <el-table-column
          type="selection"
          header-align="center"
          align="center"
          width="50"
        ></el-table-column>
        <el-table-column
          prop="id"
          label="民宿ID"
          header-align="center"
          min-width="160"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="adminName"
          label="账号名称"
          header-align="center"
          align="center"
        ></el-table-column>
        <!-- <el-table-column
          prop="code"
          label="企业编码"
          header-align="center"
          align="center"
        ></el-table-column> -->
        <el-table-column
          prop="name"
          label="商户名称"
          header-align="center"
          align="center"
          :show-overflow-tooltip="true"
          min-width="120"
        ></el-table-column>
        <el-table-column
          prop="legalPerson"
          label="企业法人"
          header-align="center"
          align="center"
          width="180"
        ></el-table-column>
        <el-table-column
          prop="createDate"
          label="地址"
          header-align="center"
          align="center"
          :show-overflow-tooltip="true"
          min-width="120"
        >
          <template slot-scope="scope">
            {{ scope.row.province }}{{ scope.row.city }}{{ scope.row.area
            }}{{ scope.row.street }}{{ scope.row.areaDetail }}</template
          ></el-table-column
        >
        <el-table-column
          prop="linkName"
          label="联系人姓名"
          header-align="center"
          align="center"
          width="180"
        ></el-table-column>
        <el-table-column
          prop="linkPhone"
          label="联系人号码"
          header-align="center"
          align="center"
          width="180"
        ></el-table-column>
        <el-table-column
          :label="$t('handle')"
          fixed="right"
          header-align="center"
          align="center"
          width="150"
        >
          <template slot-scope="scope">
            <el-button
              v-if="scope.row.status == 2&&$hasPermission('hotel:check:audit')"
              type="text"
              size="small"
              @click="addOrUpdateHandle(scope.row.id)"
              >审核</el-button
            >
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
        :current-page="page"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="limit"
        :total="total"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="pageSizeChangeHandle"
        @current-change="pageCurrentChangeHandle"
      >
      </el-pagination>
      <!-- 弹窗, 新增 / 修改 -->
      <add-or-update
        v-if="addOrUpdateVisible"
        ref="addOrUpdate"
        @refreshDataList="getDataList"
      ></add-or-update>
    </div>
  </el-card>
</template>

<script>
import mixinViewModule from "@/mixins/view-module";
import AddOrUpdate from "./hotel-add-or-update2";
export default {
  mixins: [mixinViewModule],
  data() {
    return {
      mixinViewModuleOptions: {
        getDataListURL: "/hotel/homestay/page",
        getDataListIsPage: true,
      },
     
      dataForm: {
        name: "",
        linkPhone: "",
        linkName: "",
        code: "",
        adminName: "",
        status:2,
      },
    };
  },
  components: {
    AddOrUpdate,
  },
  methods: {
   
  },
};
</script>
